package cn.sjtu.design_pattern.singleton;

/**
 * @author syo 2319615164@qq.com
 * @description 饿汉式单例
 * @date 2024/5/16
 * @Copyright syo
 */
public class Singleton01 {
    // 1. 私有化构造函数
    private Singleton01() {}

    // 2. 创建单例实例
    private static final Singleton01 INSTANCE = new Singleton01();

    // 3. 提供获取实例的方法
    public static Singleton01 getInstance() {
        return INSTANCE;
    }
}
